//
//  KRBaseTableViewController.m
//  cookBook
//
//  Created by kuroken on 16/1/30.
//  Copyright © 2016年 kuroken. All rights reserved.
//

#import "KRBaseTableViewController.h"
#import "KRNoNetCell.h"
#import "KRConst.h"

@interface KRBaseTableViewController ()

@property (nonatomic, assign, getter=isError) BOOL error;

@end

@implementation KRBaseTableViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
}

- (void)dealloc
{
    NSLog(@"%s", __func__);
}

- (void)loadData
{
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - Table view data source

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 1;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    KRNoNetCell *cell = [KRNoNetCell cellWithTableView:tableView];
    [cell setNoNetHint:@"请求超时"];
    return cell;
    
}

#pragma mark - UITableViewDelegate
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return [UIScreen mainScreen].bounds.size.height - KRTopBarHeight;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    [self.tableView reloadData];
    [self loadData];
}

@end